home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1995 October / EnigmA AMIGA RUN 01 (1995)(G.R. Edizioni)(IT)[!][issue 1995-10][Aminet 7].iso / Aminet / comm / mail / thor201.lha / THOR_2.0 / thor.lha / rexx / CfgFIDO.thor < prev    next >
Text File  |  1995-05-15  |  2KB  |  77 lines

  1. /* $VER: CfgFIDO.thor 0.4 (8.1.95)
  2.  *
  3.  * External configuration for the FIDO bbstype.
  4.  *
  5.  * Script by: Magne Østlyngen, Ultima Thule Software.
  6.  */
  7.  
  8. parse arg argument
  9. options results
  10.  
  11. template = 'BBSNAME/A,CONFNAME/K,PUBSCREEN/K'
  12.  
  13. p=address()||' '||show('P',,);if pos('THOR.',p)>0 then thorport=word(,
  14. substr(p,pos('THOR.',p)),1);else do;say 'No THOR port found!';exit 10;end
  15.  
  16. if ~show('p', 'BBSREAD') then do
  17.     address command
  18.         "run >nil: `GetEnv THOR/THORPath`bin/LoadBBSRead"
  19.         "WaitForPort BBSREAD"
  20. end
  21.  
  22. address "BBSREAD"
  23.  
  24. READARGS template ARGS CMDLINE argument
  25. if rc ~= 0 then do
  26.     address(thorport)
  27.     REQUESTNOTIFY TEXT '"'BBSREAD.LASTERROR'"' BT '"_Ok"'
  28.     exit 5
  29. end
  30.  
  31. GETBBSDATA bbsname '"'ARGS.BBSNAME'"' stem BBSDATA
  32. if rc ~= 0 then do
  33.     address(thorport)
  34.     REQUESTNOTIFY TEXT '"'BBSREAD.LASTERROR'"' BT '"_Ok"'
  35.     exit 5
  36. end
  37.  
  38. address(thorport)
  39.  
  40. origin = ""
  41. password = ""
  42. forceintl = "NO"
  43.  
  44. if open(fil, BBSDATA.BBSPATH||'fido.config', R) then do
  45.     do while ~eof(fil)
  46.         ln = readln(fil)
  47.         if upper(word(ln, 1)) = "ORIGIN:" then origin = strip(delstr(ln, 1, 7))
  48.         if upper(word(ln, 1)) = "PASSWORD:" then password = strip(delstr(ln, 1, 9))
  49.         if upper(word(ln, 1)) = "FORCEINTL:" then forceintl = strip(delstr(ln, 1, 10))
  50.     end
  51.     call close(fil)
  52. end
  53.  
  54. if forceintl ~= "YES" & forceintl ~= "NO" then do
  55.     REQUESTNOTIFY TEXT '"Error in config: FORCEINTL neither YES nor NO.\n"' BT '"_Ok"'
  56. end
  57.  
  58. REQUESTSTRING TITLE '"Enter Origin:"' BODY '"The origin line is on the format:\n\n ** Origin <text> (<address>)\n\nWhere <text> is this text, and <address> is your fido-address."' BT '"_Ok|_Cancel"' ID '"'||origin||'"' MAXCHARS 256
  59. if rc = 0 then origin = result
  60.  
  61. REQUESTSTRING TITLE '"Enter Password:"' BODY '"This is the password that is\nput into the reply-packets"' BT '"_Ok|_Cancel"' ID '"'||password||'"' MAXCHARS 8
  62. if rc = 0 then password = result
  63.  
  64. REQUESTNOTIFY TEXT '"Force INTL lines?\n\nIf you experience problems with your netmail\nnot coming to the receiver, try setting \nthis to yes."' BT '"_Yes|_No"'
  65. if rc~= 0 then exit 10
  66.  
  67. if result = 1 then forceintl = "YES"; else forceintl = "NO"
  68.  
  69. if open(fil, BBSDATA.BBSPATH||'fido.config', W) then do
  70.     if origin ~= "" then call writeln(fil, "ORIGIN: "||origin)
  71.     if password ~= "" then call writeln(fil, "PASSWORD: "||password)
  72.     if forceintl ~= "NO" then call writeln(fil, "FORCEINTL: "||forceintl)
  73.     call close(fil)
  74. end
  75.  
  76. exit 0
  77.